package de.melistik.smugmugsync.connect;

import com.kallasoft.smugmug.api.json.v1_2_1.APIVersionConstants;
import com.kallasoft.smugmug.api.json.v1_2_1.login.WithPassword;

public class SmugMugConnection {

	static public String API_KEY = "vgN8I2EBDCOlga8LTpQzcVvKuckNSpEs";

	private WithPassword.WithPasswordResponse response = null;

	public SmugMugConnection(String username, String password) {
		/* Create an instance of the WithPassword method */
		WithPassword withPassword = new WithPassword();

		/* Execute the login, passing the arguments provided */
		response = withPassword.execute(APIVersionConstants.SECURE_SERVER_URL,
				API_KEY, username, password);
	}

	public WithPassword.WithPasswordResponse getResponse() {
		return response;
	}
	
	public boolean isLoggedIn() {
		return !response.isError();
	}

}
